1. Field of the Invention
The present invention relates to a method and apparatus for displaying graphics on a display device, for use in a system, such as a computer-aided design (CAD) system, that displays many graphic items on a display device. More particularly, the invention relates to a method and apparatus for displaying graphics on a display device in a multi-window environment.
2. Description of the Related Art
Application programs implementing a CAD system generate a large number of graphic elements such as lines with their attributes, including color and line width, specified, and display the generated graphic elements sequentially on a display device Display of a graphic element is accomplished by sending to a display device a command that specifies the attributes of the graphic element, and a graphic drawing command with the coordinates of the graphic element specified.
In the multi-window environment, since screen redraw requests are generated at frequent intervals, it is required that the screen, including the many graphic elements already generated, be output at once onto the display device in the shortest possible time. To achieve this, a graphic management facility for managing graphic information is provided between the application program and the display device. The graphic management facility receives graphic element data, including data specifying, for example, color, line width, etc., from the application program, and stores them into memory. When a draw request is input from the operating system (OS) or application program, the stored data are retrieved, and screen drawing is performed by sending an attribute specifying command and a draw command to the display device accordingly. At this time, instead of outputting an attribute specifying command prior to a draw command each time the command is invoked, the graphic management facility outputs an attribute specifying command only when the attributes of the graphic element to be output are different from those of the previously output graphic element. This is necessary to finish the drawing process in the shortest possible time.
The graphic management facility is delivered, for example, in the form of a library containing a large number of subroutines. When generating an execution module for an application program, the subroutines needed by the application program are fetched into the execution module.
Such a graphic management facility has contributed to drastically reducing the length of time required from the input of a draw request until the drawing process is completed. However, the above-described graphic management facility requires that the attribute data be compared each time the graphic element data are retrieved from memory. When processing a large number of line drawing data generated in a CAD system, the length of time required for the comparison of data cannot be neglected. This has been a major obstacle to speeding up the drawing process.